@extends('admin.layouts.app')
@section('css')
<link rel="stylesheet" href="{{ asset('assets/plugins/select2/css/select2.min.css') }}" />
<link rel="stylesheet" href="{{ asset('assets/plugins/bootstrap-tagsinput/css/bootstrap-tagsinput.css') }}" />
@endsection
@section('content')
@include('vendor.ueditor.assets')

                        <!-- Page-Title -->
                        <div class="row">
                            <div class="col-sm-12">
                                <h4 class="page-title">平台管理</h4>
                                <ol class="breadcrumb">
                                    <li><a href="{{url('zadmin/')}}">系统</a></li>
                                    <li><a href="{{url('zadmin/faq')}}">常见问题管理</a></li>
                                    <li class="active">添加常见问题</li>
                                </ol>
                            </div>
                        </div>
                        
                        <div class="row">
                        	<div class="col-lg-12">
                        		<div class="card-box">
                            <h2 class="m-t-0 header-title">添加常见问题</h2>
                            <hr/>
                             
                              @include('admin.common.error')
                        			<div class="row">
			                        	<div class="col-md-9">
                                  <form class="form-horizontal" role="form" action="{{url('zadmin/faq')}}" method="post">

          <div class="form-group">
            <label class="col-md-2 control-label">标题</label>
            <div class="col-md-10">
              <input type="text" class="form-control" name="title" required="" value="" >
            </div>
         
            
          </div>
                               
       

          

           <div class="form-group">
              <label class="col-md-2 control-label">内容</label>
              <div class="col-md-10">
               <!-- 实例化编辑器 -->
<script type="text/javascript">
    var ue = UE.getEditor('container');
    ue.ready(function() {
        ue.execCommand('serverparam', '_token', '{{ csrf_token() }}'); // 设置 CSRF token.
    });
</script>

<!-- 编辑器容器 -->
<script id="container" name="contents" type="text/plain"></script>
              </div>
            </div>        
         
 
                                              

                                              

                                              <div class="form-group text-center">
                                                  
                                                  <button type="submit" class="btn btn-info waves-effect waves-light">保存</button>
                                              </div>
                                              
                                              
                             {{csrf_field()}}
                        
                    </form>
                                </div>
			                        	
			                        </div>

                             
			                        
                        			
                        		</div>
                                
                            </div> <!-- end col -->

                            
                        </div>
@endsection
                        

    
        @section('js')
        <script type="text/javascript" src="/js/plupload.full.min.js"></script>
         <script src="{{ asset('assets/plugins/select2/js/select2.full.min.js') }}" type="text/javascript"></script>
         <script src="{{ asset('assets/plugins/bootstrap-tagsinput/js/bootstrap-tagsinput.min.js') }}"></script>
        <script type="text/javascript">
          $('.select2').select2();
          var pics = '';
          var uploader = new plupload.Uploader({
              runtimes : 'html5,flash,silverlight,html4',
              browse_button : 'pickfiles',               
              url : '/upload.php',
              flash_swf_url : '../js/Moxie.swf',
              silverlight_xap_url : '../js/Moxie.xap',
              
              filters : {
                max_file_size : '10mb',
                mime_types: [
                  {title : "Image files", extensions : "jpg,gif,png"},
                  {title : "Zip files", extensions : "zip"}
                ]
              },

              init: {
                PostInit: function() {
                  $('#filelist').html('');

                  
                },

                FilesAdded: function(up, files) {
                  plupload.each(files, function(file) {
                    $('#filelist').html('<div id="' + file.id + '">' + file.name + ' (' + plupload.formatSize(file.size) + ') <b></b></div>');
                     uploader.start();
                     return false;
                  });
                },

               

                 FileUploaded: function(up, file, info) {
                    // Called when file has finished uploading
                    var rs =  JSON.parse(info.response);
                    if(rs.status){
                      var str = '<img style="padding:5px" src="'+rs.data+'" width="100">';
                      $('.piclist').append(str);
                      pics += rs.data+',';
                      $('#pics').val(pics);
                    }
                    console.info(rs);                              
                },
              }
          });
      uploader.init();

      //$('input[name="tags"]').val('hah,kkk');
        </script>
        
        @endsection
    
